﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vtron.LEDCorrective.Core.Test
{
    [TestClass]
    public class CorrectiveEngineUnitTest
    {
        /// <summary>
        /// 测试没有设置分区的时候， CountOffset 方法抛出的异常。
        /// </summary>
        [TestMethod]
        [ExpectedException(typeof(CorrectiveException))]
        public void CountOffsetWithoutSettingPartitionTest()
        {
            CorrectiveEngine correctiveEngine = CorrectiveEngine.Instance;
            correctiveEngine.Id = Guid.Empty;
            correctiveEngine.CountOffset(1);
        }

        /// <summary>
        /// 测试 CountOffset 方法。
        /// </summary>
        [TestMethod]
        public void CountOffsetTest()
        {
            CorrectiveEngine correctiveEngine = CorrectiveEngine.Instance;
            correctiveEngine.PartitionColumn = 192;
            correctiveEngine.PartitionRow = 192;
            correctiveEngine.Id = Guid.Empty;

            correctiveEngine.CountOffset(88888888);
        }
    }
}
